package freakin.wify;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class Utils {

	static public boolean isConnected(Context ctx) {
			ConnectivityManager connectManager = (ConnectivityManager) ctx
					.getSystemService(Context.CONNECTIVITY_SERVICE);

		final boolean connected = (connectManager.getNetworkInfo(
				ConnectivityManager.TYPE_MOBILE).getState() == NetworkInfo.State.CONNECTED || connectManager
				.getNetworkInfo(ConnectivityManager.TYPE_WIFI).getState() == NetworkInfo.State.CONNECTED);
		return connected;
	}
	
}
